<?php
namespace Admin\Controller;

use Common\Controller\AdminbaseController;

class QrcodeController extends AdminbaseController{

    public function index(){
        $qrcode = M("vruser1.qrcode_download",null);
        $total  = $qrcode->field('count(*) as total')->find();
        $this->assign('total', $total['total']);
        $this->display();
    }

    public function find(){
        $start_time = I('start_time', date('Y-m-d H:i:s', time()));
        $end_time   = I('end_time', date('Y-m-d H:i:s', time()));
        $qrcode = M("vruser1.qrcode_download",null);
        $result = $qrcode->where(" create_time >= '".$start_time."' and create_time <= '".$end_time."'")->field('count(*) as total')->find();
        if($result && is_array($result)){
            echo $result['total'];exit();
        }else{
            echo 0;exit();
        }
    }
}